Babbage's congruence